import { env } from '@/utils/env'
import http from './http'
import type { Area } from '@/types/Area'


export const getProvince = async () => {
    return await http<Area[]>({
        url: env.VITE_JIANCAI + '/area/province/list',
        method: 'get',
    })
}

export const getCity = async (provinceCode:string) => {
    return await http<Area[]>({
        url: env.VITE_JIANCAI + '/area/city/list',
        method: 'get',
        params: {provinceCode}
    })
}

export const getArea = async (cityCode:string) => {
    return await http<Area[]>({
        url: env.VITE_JIANCAI + '/area/area/list',
        method: 'get',
        params: {cityCode}
    })
}
